<template>
  <div class="yhq">
    <div class="phone">
      <div class="phoneTop">
        <!-- <span class="phoneTopspan">兑换券</span> -->
      </div>

      <div class="coupon" style="
          background: linear-gradient(0deg, rgb(254, 98, 99), rgb(254, 49, 78));
        ">
        <div class="couponHead">
          <span class="couponHeadTitle">{{ ruleForm.couponName }}</span>
          <a class="couponShare">分享</a>
        </div>
        <div style="
            color: #fff;
            font-size: 30px;
            text-align: center;
            margin: 0 0 20px 0;
          " v-if="ruleForm.couponAmountStr">
          {{ ruleForm.couponAmountStr }}兑换券
        </div>

        <!-- <div v-if="ruleForm.isshow == true" style="color: #fff; font-size: 14px; text-align: center">
          满任意金额可用
        </div> -->
        <!-- <div v-if="ruleForm.isshow == false && ruleForm.baseAmountStr > 0"
          style="color: #fff; font-size: 14px; text-align: center">
          满{{ ruleForm.baseAmountStr }}元可用
        </div> -->
        <div v-if="ruleForm.startDate" style="
            font-size: 14px;
            margin-top: 15px;
            color: hsla(0, 0%, 100%, 0.5);
          ">
          有效日期：{{ ruleForm.startDate }} 到 {{ ruleForm.endDate }}
        </div>
      </div>
      <div class="couponbottom"></div>
      <p class="instructions">使用说明</p>
      <div class="instructionsTitle">
        <div>{{ ruleForm.couponName }}</div>
        <div style="margin: 10px 0" v-if="ruleForm.startDate">
          活动时间：{{ ruleForm.startDate }} 到 {{ ruleForm.endDate }}
        </div>
        <div v-if="ruleForm.couponName">
          兑换券数量：<span v-if="ruleForm.checkProduct == 0">全部</span><span v-else>部分</span>商品可用

        </div>
      </div>
    </div>

    <!-- 表单 -->
    <div class="formdata">
      <div class="setup big_title_style">基本设置</div>
      <el-form :model="ruleForm" ref="ruleForm" label-width="120px" :rules="rules">
        <el-form-item label="兑换券图标" prop="couponIconUrl">
          <imageArraySize :imageStr.sync="ruleForm.couponIconUrl" :key="ruleForm.couponIconUrl" :msg="'图片要求：大小1MB以内。'"
            :limit="1" ref="childss">
          </imageArraySize>
        </el-form-item>
        <el-form-item label="兑换券名称" prop="couponName">
          <el-input v-model="ruleForm.couponName" placeholder="请输入兑换券名称" clearable maxlength="15" show-word-limit>
          </el-input>
        </el-form-item>
        <el-form-item label="兑换券描述">
          <el-input v-model="ruleForm.couponDesc" placeholder="请输入兑换券描述" clearable maxlength="25" show-word-limit>
          </el-input>
        </el-form-item>
        <el-form-item label="兑换券数量" prop="couponNums">
          <el-radio style="margin-top: 12px" v-model="ruleForm.checkNumber" label="-1" @change="ischeckNumber()">无限制发放
          </el-radio>

          <el-radio style="margin-top: 15px" v-model="ruleForm.checkNumber" label="1">发放<el-input class="ml10"
              v-model="ruleForm.couponNums" oninput="value=value.replace(/[^\d]/g,'')" placeholder="请输入数字" clearable
              :disabled="ruleForm.checkNumber != 1" maxlength="7" show-word-limit></el-input>
            <div class="couponNumsDiv">张</div>
          </el-radio>

        </el-form-item>

        <el-form-item label="是否重复领取" required>
          <el-radio style="margin-top: 12px" v-model="ruleForm.isRepeat" label="1">可以重复领取</el-radio>
          <el-radio style="margin-top: 15px" v-model="ruleForm.isRepeat" label="0">不能重复领取</el-radio>

        </el-form-item>

        <el-form-item label="是否通用" required>
          <el-radio style="margin-top: 12px" v-model="ruleForm.isCommon" label="1" @input="storeChange">通用</el-radio>
          <el-radio style="margin-top: 15px" v-model="ruleForm.isCommon" label="0">指定门店</el-radio>
          <a v-if="(ruleForm.isCommon == 0)" style="color: #155bd4" @click="selectStore">选择门店</a>
          <selectedStore ref="childStores" style="margin-top: 10px;" v-if="selectedDataStores.length > 0"
            :selectedData="selectedDataStores">
          </selectedStore>
        </el-form-item>

        <el-form-item label="适用类型 " prop="couponProType">

          <el-radio style="margin-top: 12px" v-model="ruleForm.couponProType" label="card">套餐卡</el-radio>

          <el-radio style="margin-top: 15px" v-model="ruleForm.couponProType" label="service">服务项目</el-radio>
          <el-radio style="margin-top: 15px" v-model="ruleForm.couponProType" label="product">商品</el-radio>

          <a v-if="ruleForm.couponProType == 'card'" style="color: #155bd4" @click="selectCommodityCard">选择套餐卡</a>

          <a v-if="ruleForm.couponProType == 'service'" style="color: #155bd4" @click="selectCommodityService">服务项目</a>

          <a v-if="ruleForm.couponProType == 'product'" style="color: #155bd4" @click="selectCommodityProduct">选择商品</a>

          <div class="mt10" v-if="ruleForm.couponProType == 'service'">
            <selectedA ref="childStore" style="margin-top: 10px;" v-if="Object.keys(this.selectedDataStore).length > 0"
              :selectedData="selectedDataStore" @tabRespon="tabRespon">
            </selectedA>
          </div>

          <div class="mt10" v-if="ruleForm.couponProType == 'card'">
            <selectedCard ref="childCard" style="margin-top: 10px;" v-if="Object.keys(this.selectedDataCard).length > 0"
              :selectedData="selectedDataCard" @tabRespon="tabResponCard">
            </selectedCard>
          </div>

          <div class="mt10" v-if="ruleForm.couponProType == 'product'">
            <SelectedPro ref="childProduct" style="margin-top: 10px;"
              v-if="Object.keys(this.selectedDataProduct).length > 0" :selectedData="selectedDataProduct"
              @tabRespon="tabResponProduct"></SelectedPro>
          </div>
        </el-form-item>

        <el-form-item label="用券时间" prop="expireDays">
          <el-radio v-model="ruleForm.checkTime" label="0" @change="ischecktime(ruleForm.checkTime)">
            <el-date-picker :disabled="ruleForm.checkTime != '0'" v-model="timeValue" type="datetimerange"
              range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" @change="getSTime">
            </el-date-picker>
          </el-radio>
          <el-radio style="margin-top: 15px" v-model="ruleForm.checkTime" label="1"
            @change="ischecktime(ruleForm.checkTime)">
            领券当日起<el-input style="width: 120px; margin: 0 10px" v-model="ruleForm.expireDays"
              :disabled="ruleForm.checkTime != '1'" maxlength="3" show-word-limit
              oninput="value=value.replace(/[^\d]/g,'')" placeholder="请输入数字">
            </el-input>天内可用
          </el-radio>
          <p style="
              font-size: 12px;
              color: #969799;
              line-height: 15px;
              width: 390px;
              margin-top: 10px;
            ">
            若设置固定用券时间，编辑保存后对已领取未使用及后续领取的券均生效。若设置领券当日/次日n天内可用，编辑保存后仅对后续领取的券生效
          </p>
        </el-form-item>

        <el-form-item label="备注">
          <el-input  type="textarea" v-model.trim="ruleForm.remark" :rows="3" placeholder="请输入内容">
          </el-input>
        </el-form-item>

      </el-form>
    </div>
    <div class="yhqBottom">
      <el-button type="primary" style="color: #fff" @click="preservation">保存</el-button>
      <el-button @click="close()">取消</el-button>
    </div>

    <!-- <el-dialog v-if="ruleForm.open" title="选择商品" :visible.sync="ruleForm.open" width="800px" append-to-body @close="closeDialog()"> -->
    <commodityCard v-if="cardAOpen" @toCloseBox="toCloseBoxCard" @multipleSelection="multipleSelectionCard"
      :flag="cardAOpen" :source="false" ref="selTableCard"></commodityCard>

    <commodityItem v-if="storeOpen" @toCloseBox="toCloseBoxStore" @multipleSelection="multipleSelectionStore"
      :flag="storeOpen" :source="false" ref="selTableStore"></commodityItem>

    <commodityPro v-if="productOpen" @toCloseBox="toCloseBoxProduct" @multipleSelection="multipleSelectionProduct"
      :flag="productOpen" :source="false" ref="selTableProduct" />

    <commodityStore v-if="storeOpens" @toCloseBox="toCloseBoxStores" @multipleSelection="multipleSelectionStores"
      :flag="storeOpens" :source="false" ref="selTableStores"></commodityStore>

    <!-- </el-dialog> -->
  </div>
</template>
<script>
import { getCoupon, addCoupon, updateCoupon } from "@/api/activity/coupon";
import SelectedPro from "@/components/radio/SelectedPro";
import selectedA from "@/components/radio/SelectedItem";
import commodityItem from "@/components/radio/commodityItem";
import commodityCard from "@/components/radio/commodityCard";
import commodityPro from "@/components/radio/commodityPro";
import SelectedCard from "@/components/radio/SelectedCard";

import commoditytab from "@/components/Activity/commodityTab";
import selected from "@/components/Activity/SelectedProducts";
import imageArraySize from "@/components/ImageUpload/imageArraySize";


import selectedStore from "@/components/Activity/SelectedStore";
import commodityStore from "@/components/Activity/commodityStore";
export default {
  components: {
    commoditytab,
    selected,
    imageArraySize,

    SelectedPro,
    selectedA,
    SelectedCard,
    commodityItem,
    commodityCard,
    commodityPro, selectedStore, commodityStore
  },
  data() {
    return {
      storeOpens: false,
      selectedDataStores: [],
      subFlag: true,
      proUids: [], //排除商品，活动用到
      // selectedData: [],
      timeValue: [],
      // open: false,

      storeOpen: false,
      selectedDataStore: {},
      cardAOpen: false,
      selectedDataCard: {},
      productOpen: false,
      selectedDataProduct: {},

      ruleForm: {
        couponUid: null,
        couponIconUrl: "",
        couponName: "",
        couponDesc: "",
        couponType: "4",
        couponNums: 0,
        couponAmount: 0,
        baseAmount: 1,
        couponAmountStr: 0,
        baseAmountStr: 0,
        startDate: "",
        endDate: "",
        expireType: "",
        expireDays: "",
        couponProUids: null,
        isshow: true,
        checkTime: "0",

        checkNumber: "-1",
        couponProType: "",
        checkBaseAmount: "0",
        isRepeat: "0",
        isCommon: '1'
      },
      rules: {
        couponProType: [
          {
            required: true,
            message: "请选择适用类型",
            trigger: 'change',
          },
        ],
        couponName: [
          {
            required: true,
            message: "不能为空",
            trigger: "blur",
          },
        ],
        couponAmount: [
          {
            required: true,
            message: "不能为空",
            trigger: "blur",
          },
        ],
        couponNums: [
          {
            required: true,
            message: "不能为空",
            trigger: "blur",
          },
        ],
        couponProType: [
          {
            required: true,
            message: "请选择适用类型",
            trigger: 'change',
          },
        ],
        expireDays: [
          {
            required: true,
            message: "不能为空",
            trigger: "blur",
          },
        ],
      },
    };
  },
  created() {
    this.getCoupon();
  },
  methods: {
    storeChange() {
      this.selectedDataStores = []
    },
    toCloseBoxStores() {
      this.storeOpens = false;
    },
    multipleSelectionStores(data) {
      this.storeOpens = false
      this.selectedDataStores = data;
      this.$nextTick(() => {
        this.$refs.childStores.getList();
      });
    },
    selectStore() {
      this.$forceUpdate()
      this.storeOpens = true;
      this.$nextTick(() => {
        this.$refs["selTableStores"].greet(this.selectedDataStores);
      });
    },
    getCoupon() {
      let $this = this;
      const couponUid = $this.$route.params && $this.$route.params.couponUid;
      if (couponUid) {
        getCoupon(couponUid).then((response) => {
          var d = response.data;
          $this.ruleForm = {
            ...$this.ruleForm,
            ...d
          };
          if ($this.ruleForm.couponNums > 0) {
            $this.ruleForm.checkNumber = '1'
          } else {
            $this.ruleForm.checkNumber = '-1'
          }
          $this.ruleForm.baseAmountStr = parseFloat(d.baseAmountStr);
          $this.ruleForm.couponAmountStr = parseFloat(d.couponAmountStr);
          if (d.proList) {
            $this.selectedData = d.proList;
          }
          if (d.checkBaseAmount == "1") {
            $this.ruleForm.isshow = false;
          } else {
            $this.ruleForm.isshow = true;
          }
          $this.timeValue.push($this.ruleForm.startDate || '');
          $this.timeValue.push($this.ruleForm.endDate || '');
          this.selectedDataStores = d.storeList || []

          if (this.ruleForm.couponProType == "card") {
            this.selectedDataCard = this.ruleForm.selectData;
          } else if (this.ruleForm.couponProType == "service") {
            this.selectedDataStore = this.ruleForm.selectData;
          } else if (this.ruleForm.couponProType == "product") {
            this.selectedDataProduct = this.ruleForm.selectData;
          }



        });
      }
    },

    ischecktime(v) {
      //清除之前的校验
      this.$refs.ruleForm.clearValidate();
      this.ruleForm.expireDays = "";
      // console.log(this.ruleForm);
      if (v == "0" && this.timeValue && this.timeValue.length > 0)
        this.ruleForm.expireDays = "0";
    },
    ischeckNumber() {
      //清除之前的校验
      //this.$refs.ruleForm.clearValidate();
      this.ruleForm.couponNums = null;
      console.log(this.ruleForm);

    },

    //提交保存
    preservation() {
      let proUids = null;
      if (this.selectedData) {
        proUids = "";
        this.selectedData.forEach((d) => {
          proUids += d.productUid + ",";
        });
      }
      this.ruleForm.couponProUids = proUids;

      //适用类型获取数据判断


      if (this.ruleForm.couponProType == 'card') {
        // 获取id  this.selectedDataCard
        this.ruleForm.couponProUids = this.selectedDataCard.cardId;
        if (this.ruleForm.couponProUids == null) {
          this.msgError("请选择套餐卡数据");
          return
        }

      } else if (this.ruleForm.couponProType == 'service') {

        // 获取id  this.selectedDataStore
        this.ruleForm.couponProUids = this.selectedDataStore.itemId;
        if (this.ruleForm.couponProUids == null) {
          this.msgError("请选择服务项目数据");
          return
        }
      } else if (this.ruleForm.couponProType == 'product') {
        // 获取id  this.selectedDataProduct
        this.ruleForm.couponProUids = this.selectedDataProduct.productUid;
        if (this.ruleForm.couponProUids == null) {
          this.msgError("请选择商品数据");
          return
        }
      }

      //图片上传组件需要定义
      this.$refs.childss.selectImgs();

      this.$refs["ruleForm"].validate((valid) => {
        if (valid && this.subFlag) {
          if (
            this.ruleForm.checkTime &&
            this.ruleForm.checkTime == "1" &&
            this.ruleForm.expireDays == "0"
          ) {
            return this.msgError("用劵天数需大于0");
          }
          this.ruleForm.baseAmount = parseInt(
            parseFloat(this.ruleForm.baseAmountStr) * 100
          );
          this.ruleForm.couponAmount = parseInt(
            parseFloat(this.ruleForm.couponAmountStr) * 100
          );

          if (this.ruleForm.checkNumber == -1) {
            this.ruleForm.couponNums == -1
          }
          console.log(this.ruleForm);
          const couponUid = this.$route.params && this.$route.params.couponUid;


          let qf = [];
          this.selectedDataStores.forEach(vo => {
            qf.push(vo.storeUid);
          })
          this.ruleForm.longList = qf;
          if (couponUid) {
            this.ruleForm.couponUid = couponUid;
            updateCoupon(this.ruleForm).then((respone) => {
              this.msgSuccess("修改成功");
              this.close();
              // this.$router.go(-1);
              this.selectedDataCard = {}
              this.selectedDataStore = {}
              this.selectedDataProduct = {}
            });
          } else {
            addCoupon(this.ruleForm).then((respone) => {
              this.msgSuccess("添加成功");
              this.close();
              this.selectedDataCard = {}
              this.selectedDataStore = {}
              this.selectedDataProduct = {}
              // this.$router.go(-1);
            });
          }
          this.subFlag = false;
        }
      });
    },

    /** 关闭按钮 */
    close() {
      this.$store.dispatch("tagsView/delView", this.$route);
      this.$router.push({
        path: "/centre/coupon/couponManager",
        query: {
          t: Date.now(),
        },
      });
    },
    // multipleSelection (data) {
    //   this.open = false;
    //   this.selectedData = data;
    //   this.$nextTick(() => {
    //     this.$refs.child.getList();
    //   });
    // },
    // toCloseBox () {
    //   this.open = false;
    // },
    tabResponCard() {
      this.selectedDataCard = {}
    },
    tabRespon() {
      this.selectedDataStore = {}
    },
    tabResponProduct() {
      this.selectedDataProduct = {}
    },

    multipleSelectionCard(data) {
      this.cardAOpen = false
      this.selectedDataCard = data;
      this.$nextTick(() => {
        this.$refs.childCard.getList();
      });
    },

    multipleSelectionProduct(data) {
      this.productOpen = false
      this.selectedDataProduct = data;
      this.$nextTick(() => {
        this.$refs.childProduct.getList();
      });
    },

    multipleSelectionStore(data) {

      this.storeOpen = false
      this.selectedDataStore = data;
      this.$nextTick(() => {
        this.$refs.childStore.getList();
      });
    },

    toCloseBoxCard() {
      this.cardAOpen = false;
    },

    toCloseBoxProduct() {
      this.productOpen = false;
    },

    toCloseBoxStore() {
      this.couponOpen = false;
    },

    //调用子组件中方法，向子组件传值
    selectCommodityCard() {
      this.$forceUpdate()
      this.cardAOpen = true;
      this.$nextTick(() => {
        this.$refs["selTableCard"].greet(this.selectedDataCard);
      });
    },

    selectCommodityService() {
      this.$forceUpdate();
      this.storeOpen = true;
      this.$nextTick(() => {
        this.$refs["selTableStore"].greet(this.selectedDataStore);
      });
    },

    selectCommodityProduct() {
      this.productOpen = true;
      this.$nextTick(() => {
        this.$refs["selTableProduct"].greet(this.selectedDataProduct);
      });
    },

    // selectCommodity () {
    //   this.$forceUpdate();
    //   this.open = true;
    //   this.$nextTick(() => {
    //     this.$refs["selTable"].greet(this.selectedData);
    //   });
    // },
    p(s) {
      return s < 10 ? "0" + s : s;
    },
    getSTime(val) {
      if (val) {
        //手动赋值，使其通过校验
        this.ruleForm.expireDays = "0";
        const d = new Date(val[0]);
        const resDate =
          d.getFullYear() +
          "-" +
          this.p(d.getMonth() + 1) +
          "-" +
          this.p(d.getDate());
        const resTime =
          this.p(d.getHours()) +
          ":" +
          this.p(d.getMinutes()) +
          ":" +
          this.p(d.getSeconds());
        this.ruleForm.startDate = resDate + " " + resTime;
        const c = new Date(val[1]);
        const resDatec =
          c.getFullYear() +
          "-" +
          this.p(c.getMonth() + 1) +
          "-" +
          this.p(c.getDate());
        const resTimec =
          this.p(c.getHours()) +
          ":" +
          this.p(c.getMinutes()) +
          ":" +
          this.p(c.getSeconds());
        this.ruleForm.endDate = resDatec + " " + resTimec;
      } else {
        this.ruleForm.expireDays = ''
        this.ruleForm.startDate = ''
        this.ruleForm.endDate = ''
      }

    },

    baseAmount0() {
      this.ruleForm.isshow = true;
    },
    baseAmount1() {
      this.ruleForm.isshow = false;
    },
    submitForm(formName) {
      this.$refs[formName].validate((valid) => {
        if (valid) {
          alert("submit!");
        } else {
          console.log("error submit!!");
          return false;
        }
      });
    },
    resetForm(formName) {
      this.$refs[formName].resetFields();
    },
    closeDialog() {
      this.open = false;
      console.log(this.ruleForm.open);
    },
    oninput(num, limit) {
      var str = num;
      var len1 = str.substr(0, 1);
      var len2 = str.substr(1, 1);
      if (str.length > 1 && len1 == 0 && len2 != ".") {
        str = str.substr(1, 1);
      }
      if (len1 == ".") {
        str = "";
      }
      if (str.indexOf(".") != -1) {
        var str_ = str.substr(str.indexOf(".") + 1);
        if (str_.indexOf(".") != -1) {
          str = str.substr(0, str.indexOf(".") + str_.indexOf(".") + 1);
        }
      }
      //正则替换
      str = str.replace(/[^\d^\.]+/g, ""); // 保留数字和小数点
      if (limit / 1 === 1) {
        str = str.replace(/^\D*([0-9]\d*\.?\d{0,1})?.*$/, "$1"); // 小数点后只能输 1 位
      } else {
        str = str.replace(/^\D*([0-9]\d*\.?\d{0,2})?.*$/, "$1"); // 小数点后只能输 2 位
      }
      return str;
    },
  },
};
</script>
<style lang="less" scoped>
::v-deep .el-range-editor.is-disabled {
  border-color: #e4e7ed !important;
}

.yhq {
  display: flex;
  justify-content: center;
  padding-top: 30px;
  width: 100%;
  height: 100%;

  .phone {
    width: 360px;
    height: 580px;
    background-color: #f9f9f9;
    border: 1px solid #ccc;

    .phoneTop {
      width: 100%;
      height: 60px;
      background-image: url(../../../assets/images/phoneTops.png);
      background-repeat: no-repeat;
      background-size: 100% 100%;

      .phoneTopspan {
        color: #fff;
        position: relative;
        left: 42%;
        top: 44%;
        transform: translate(-50%, -50%);
        font-size: 18px;
        font-weight: bolder;
      }
    }

    .couponTitle {
      color: #ccc;
      height: 15px;
      line-height: 15px;
      text-align: center;
    }

    .coupon {
      width: 100%;
      height: 180px;

      .couponHead {
        width: 100%;
        position: relative;

        .couponHeadTitle {
          font-size: 18px;
          line-height: 55px;
          max-width: 290px;
          color: #fff;
          margin-left: 10px;
        }

        .couponShare {
          border: 1px solid #ffbabb;
          border-color: hsla(0, 0%, 100%, 0.5);
          border-radius: 4px;
          color: hsla(0, 0%, 100%, 0.5);
          cursor: pointer;
          height: 30px;
          line-height: 30px;
          text-align: center;
          width: 50px;
          position: absolute;
          top: 10px;
          right: 10px;
          font-weight: bold;
          font-size: 15px;
        }
      }
    }

    .couponbottom {
      background-size: 15px 15px;
      -webkit-clip-path: inset(0 0 2px 0);
      clip-path: inset(0 0 2px 0);
      content: " ";
      display: block;
      height: 10px;
      background-image: radial-gradient(rgb(249, 249, 249) 0px,
          rgb(249, 249, 249) 5px,
          rgb(254, 98, 99) 5px,
          rgb(254, 98, 99) 100%);
    }

    .instructions {
      color: #333;
      padding-left: 10px;
      font-size: 15px;
      font-weight: bold;
      margin: 5px 0;
    }

    .instructionsTitle {
      background: #fff;
      border-bottom: 1px solid #e5e5e5;
      border-top: 1px solid #e5e5e5;
      color: #333;
      font-size: 14px;
      line-height: 1.5;
      width: 100%;
      height: 140px;
      max-height: 200px;
      min-height: 22px;
      overflow: hidden;
      padding: 10px;
      text-overflow: ellipsis;
      white-space: pre-line;
      word-break: break-word;
    }
  }

  .formdata {
    width: 720px;
    height: 100%;
    overflow-y: auto;
    margin-left: 100px;
    background-color: #fff;
    padding: 20px 20px 68px 20px;
    border-radius: 10px;
    border: 1px solid #eee;

    .setup {
      border-bottom: 1px solid #ebedf0;
      font-size: 18px;
      padding-bottom: 8px;
      margin-bottom: 24px;
    }

    .couponNumsDiv {
      background-color: var(--theme-stroke-8, #f7f8fa);
      color: #646566;
      display: inline-block;
      height: 32px;
      line-height: 32px;
      padding: 0 9px;
      box-sizing: border-box;
      vertical-align: middle;
      font-size: 14px;
      position: relative;
      right: 34px;
      top: -1px;
      border-left: 1px solid #dcdee0;
    }

    .baseAmountDiv {
      background-color: var(--theme-stroke-8, #f7f8fa);
      color: #646566;
      display: inline-block;
      height: 32px;
      line-height: 32px;
      padding: 0 9px;
      box-sizing: border-box;
      vertical-align: middle;
      font-size: 14px;
      position: relative;
      right: 44px;
      top: -2px;
      border-left: 1px solid #dcdee0;
    }

    .couponAmountDiv {
      background-color: var(--theme-stroke-8, #f7f8fa);
      color: #646566;
      display: inline-block;
      height: 32px;
      line-height: 32px;
      padding: 0 9px;
      box-sizing: border-box;
      vertical-align: middle;
      font-size: 14px;
      position: relative;
      right: 34px;
      top: -2px;
      border-left: 1px solid #dcdee0;
    }
  }

  .el-input {
    width: 240px;
  }

  /deep/ .el-radio {
    display: block;

    white-space: normal;
    margin-right: 0;
  }

  .yhqBottom {
    position: fixed;
    bottom: 0;
    z-index: 10;
    left: 0;
    width: 100%;
    height: 68px;
    padding-left: 120px;
    box-shadow: 0 -2px 8px rgb(200 201 204 / 20%);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
  }
}
</style>
